#{extends 'main.html' /}
#{set title:'Inscription' /}
#{if flash.error}
    <h4 class="alert_error">${flash.error}</h4>
#{/if}
#{if flash.success}
    <h4 class="alert_success">${flash.success}</h4>
#{/if}

#{form @Application.inscriptionSave(), id:'createForm'}
<div class="module_content">
    <fieldset style="padding-left: 60px;text-align: left; border:0;">
    	<h3>Formulaire d'inscription</h3>
        <label>Prénom : </label>
        <input style="margin-left:95px" type="text" name="entity.firstname" value="${entity?.firstname}"/>
        <span class="error">${errors.forKey('entity.firstname')}</span>
		<br />
		<br />
        <label>Nom : </label>
        <input style="margin-left:116px"  type="text" name="entity.lastname" value="${entity?.lastname}"/>
        <span class="error">${errors.forKey('entity.lastname')}</span>
		<br />
		<br />
        <label>Date de Naissance : </label>
        #{if entity?.birthday == null}
        <input style="margin-left:19px" id="birthday" type="date" name="entity.birthday" 
               value="${entity?.birthday}"
               size="10" />
        #{/if}
        #{else}
        <input style="margin-left:19px" id="birthday" type="date" name="entity.birthday" 
               value="${entity?.birthday.format('dd/MM/yyyy')}"
               size="10" />
        #{/else}
        <span class="error">${errors.forKey('entity.birthday')}</span><span style="margin-left:15px;">Sous la Forme : jj/mm/aaaa</span>
		<br />
		<br />
        <label>Avatar : </label>
        <input style="margin-left:103px" type="text" name="entity.avatar" value="${entity?.avatar}"/>
        <span class="error">${errors.forKey('entity.avatar')}</span>
		<br />
		<br />
        <label>Adresse : </label>
        <input style="margin-left:94px" type="text" name="entity.adress" value="${entity?.adress}"/>
        <span class="error">${errors.forKey('entity.adress')}</span>
		<br />
		<br />
        <label>N° de Téléphone : </label>
        <input style="margin-left:32px" type="text" name="entity.phonenumber" value="${entity?.phonenumber}"/>
        <span class="error">${errors.forKey('entity.phonenumber')}</span>
		<br />
		<br />
        <label>Courrier Electronique : </label>
        <input type="text" name="entity.email" value="${entity?.email}"/>
        <span class="error">${errors.forKey('entity.email')}</span>
		<br />
		<br />
        <label>Nom d'utilisateur : </label>
        <input style="margin-left:28px" type="text" name="entity.username" value="${entity?.username}"/>
        <span class="error">${errors.forKey('entity.username')}</span>
		<br />
		<br />
        <label>Mot de Passe : </label>
        <input style="margin-left:56px" type="password" name="entity.password" value="${entity?.password}"/>
        <span class="error">${errors.forKey('entity.password')}</span>
        <br />
        <br />
    </fieldset>
    <input type="hidden" name="entity.id" value="${entity?.id}"/>
    <input type="hidden" name="entity.groups.id" value="4" />
</div>
<div style="min-width:100%;">
    <div class="submit_link">
        <input type="submit" name="submit" value="Créer !" class="alt_btn"/>
    </div>
</div>
#{/form}